﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 共享单车管理系统
{
    public partial class Tproducts : Form
    {
        public Tproducts()
        {
            InitializeComponent();
        }

        private void Tproducts_Load(object sender, EventArgs e)
        {
            DB.GetCn();
            string str = "select * from Bike where BikeID = '" + Form1.BikeID + "'";
            DataTable dt = DB.GetDataSet(str);

            bikeid.Text = Form1.BikeID;
            leixing.Text = dt.Rows[0][1].ToString();
            dizhi.Text = dt.Rows[0][2].ToString();
            zhaungt.Text = dt.Rows[0][3].ToString();
            jiagge.Text = dt.Rows[0][4].ToString();
            miaoshu.Text= dt.Rows[0][6].ToString();
            kucun.Text= dt.Rows[0][7].ToString();
            try
            {
                pictureBox1 .Image= Image.FromFile(Application.StartupPath + dt.Rows[0][5].ToString());
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            }
            catch
            {
                pictureBox1.Image= Image.FromFile(Application.StartupPath + "//" + "无.gif");
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
